package model

import (
	"context"
	"service/ctrl"
	"service/model/mod"

	comm "gitee.com/cloudapex/protos/comm/pb"
	gpb "gitee.com/cloudapex/protos/crm_base/pb"
	"google.golang.org/grpc"
)

var ProjConf projConf

type projConf struct {
	cli gpb.ProConfSerClient
}

func init() {
	ctrl.GCon.RegistClienter(mod.GCONN_CRM_BASE, func(c *grpc.ClientConn) {
		ProjConf.cli = gpb.NewProConfSerClient(c)
	})
}

//说明：获取配置信息列表
//参数：1.ProParam 项目设置信息
func (this *projConf) GetProParamList(ctx context.Context, in *gpb.ProConfReq) (*gpb.ProConfListRes, error) {
	return this.cli.GetProParamList(ctx, in)
}

//说明：更改单条配置信息
//参数：1.ProParam 项目设置信息
func (this *projConf) EditProParam(ctx context.Context, in *gpb.ProConfig) (*comm.BaseRes, error) {
	return this.cli.EditProParam(ctx, in)
}
